Skip to content

Conversation

prestoalvarez
Copy link

Summary

Fix resource leak in prometheus service test by properly closing HTTP response body.

Problem

The test was making HTTP requests but not closing resp.Body, causing potential connection leaks and file descriptor exhaustion in test environments.

Changes

  • monitoring/prometheus/service_test.go: Add defer resp.Body.Close() after HTTP GET request

Impact

  • Internal test code only; no user-facing behavior changes
  • Improves test reliability by preventing resource leaks
  • Follows standard Go HTTP client best practices

prestonvanloon
prestonvanloon previously approved these changes Oct 9, 2025
Copy link
Member

@prestonvanloon prestonvanloon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs a changelog fragement to satisfy CI. Otherwise LGTM! thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants